home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS02.ADF / IFF / packer.h < prev    next >
Text File  |  1989-05-30  |  2KB  |  41 lines

  1. #ifndef PACKER_H
  2. #define PACKER_H
  3. /*----------------------------------------------------------------------*
  4.  * PACKER.H  typedefs for Data-Compresser.                 11/15/85
  5.  *
  6.  * This module implements the run compression algorithm "cmpByteRun1"; the
  7.  * same encoding generated by Mac's PackBits.
  8.  *
  9.  * By Jerry Morrison and Steve Shaw, Electronic Arts.
  10.  * This software is in the public domain.
  11.  *
  12.  * This version for the Commodore-Amiga computer.
  13.  *----------------------------------------------------------------------*/
  14.  
  15. #ifndef EXEC_TYPES_H
  16. #include "exec/types.h"
  17. #endif
  18.  
  19. /* This macro computes the worst case packed size of a "row" of bytes. */
  20. #define MaxPackedSize(rowSize)  ( (rowSize) + ( ((rowSize)+127) >> 7 ) )
  21.  
  22.  
  23. /* Given POINTERS to POINTER variables, packs one row, updating the source
  24.  * and destination pointers. Returns the size in bytes of the packed row.
  25.  * ASSUMES destination buffer is large enough for the packed row.
  26.  * See MaxPackedSize. */
  27. extern LONG PackRow(BYTE **, BYTE **, LONG);
  28.         /*  pSource, pDest,   rowSize */
  29.  
  30. /* Given POINTERS to POINTER variables, unpacks one row, updating the source
  31.  * and destination pointers until it produces dstBytes bytes (i.e., the
  32.  * rowSize that went into PackRow).
  33.  * If it would exceed the source's limit srcBytes or if a run would overrun
  34.  * the destination buffer size dstBytes, it stops and returns TRUE.
  35.  * Otherwise, it returns FALSE (no error). */
  36. extern BOOL UnPackRow(BYTE **, BYTE **, WORD,     WORD);
  37.           /*  pSource, pDest,   srcBytes, dstBytes  */
  38.  
  39. #endif
  40.  
  41.